<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .container {
            width: 1000px;
            height: 1000px;
            display: flex;
            /* 使用flex弹性布局 */
            background: #f2f2f2;
            /* 1. flex默认使用横向排版从左到右 */
            /* flex-direction: row; */
            /* 2. flex横向从右到左 */
            /* flex-direction: row-reverse; */
            /* 3. 在布局方向上可以使用特殊的布局方式 */
            /* a. 居中 */
            /* justify-content: center; */
            /* b. 居左 居右 */
            /* justify-content: flex-start; */
            /* justify-content: flex-end; */
            /* c. 均分布局 */
            /* justify-content: space-around; */
            /* d. 两端对齐 */
            justify-content: space-between;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="item">元素1</div>
        <div class="item">元素2</div>
        <div class="item">元素3</div>
        <div class="item">元素4</div>
    </div>
</body>

</html>